package com.hoshiibuy.sys.permission.entity.param;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import lombok.Data;

@Data
public class GetChildListParam implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@SuppressWarnings("unused")
	private GetChildListParam() {

	}

	public GetChildListParam(String parentId, String idColumnName, String parentIdColumnName, String tableName) {
		this.parentId = parentId;
		this.idColumnName = idColumnName;
		this.parentIdColumnName = parentIdColumnName;
		this.tableName = tableName;
	}

	/**
	 * 要查询的父ID
	 */
	private String parentId;

	/**
	 * id列名
	 */
	private String idColumnName;

	/**
	 * 父ID列名
	 */
	private String parentIdColumnName;

	/**
	 * 返回值
	 */
	private String retVal;

	/**
	 * 查询的表名
	 */
	private String tableName;

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getIdColumnName() {
		return idColumnName;
	}

	public void setIdColumnName(String idColumnName) {
		this.idColumnName = idColumnName;
	}

	public String getParentIdColumnName() {
		return parentIdColumnName;
	}

	public void setParentIdColumnName(String parentIdColumnName) {
		this.parentIdColumnName = parentIdColumnName;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getRetVal() {
		return retVal;
	}

	public void setRetVal(String retVal) {
		this.retVal = retVal;
	}

	public boolean valid() {
		if (StringUtils.isBlank(this.parentId) || StringUtils.isBlank(this.idColumnName)
				|| StringUtils.isBlank(this.parentIdColumnName) || StringUtils.isBlank(this.tableName)) {
			return false;
		}
		return true;
	}

}
